package com.yuanlrc.base.entity.common;

import com.yuanlrc.base.annotion.ValidateEntity;
import com.yuanlrc.base.entity.admin.BaseEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 * 2月14日
 * 物品分类实体类
 * @author Administrator
 *
 */
@Entity
@Table(name="bishe_home_user")
@EntityListeners(AuditingEntityListener.class)
public class HomeUser extends BaseEntity {

	/**
	 * 
	 */
	public static final int HOMEUSER_STATUS_ENABLE=1;//状态可用
	public static final int HOMEUSER_STATUS_UNABLE =0;//状态不可用

	private static final long serialVersionUID = 1L;
	
	@ValidateEntity(required=true,requiredLeng=true,minLength=6,maxLength=18,errorRequiredMsg="账号不能为空!",errorMinLengthMsg="账号长度需大于6!",errorMaxLengthMsg="账号长度不能大于18!")
	@Column(name="userid",nullable=false,length=18,unique = true)
	private String userid;//账号

	@ValidateEntity(required=true,requiredLeng=true,minLength=6,maxLength=18,errorRequiredMsg="密码不能为空!",errorMinLengthMsg="密码长度需大于6!",errorMaxLengthMsg="密码长度不能大于18!")
	@Column(name="password",length=32)
	private String password;//用户密码

	@ValidateEntity(required=false)
	@Column(name="nickname",length=32)
	private String nickname;//昵称

	@ValidateEntity(required=false)
	@Column(name="userid_pic",length=128)
	private String useridPic;//头像

	@ValidateEntity(required=false)
	@Column(name="mobile",length=11)
	private String mobile;//手机号

	@ValidateEntity(required=false)
	@Column(name="address",length=32)
	private String address;//地址

	@ValidateEntity(required=true)
	@Column(name="qq",length=18)
	private String qq;//qq号

	@ValidateEntity(required=false)
	@Column(name="status",length=1)
	private int status=HOMEUSER_STATUS_ENABLE;//状态

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}


	public String getUseridPic() {
		return useridPic;
	}

	public void setUseridPic(String useridPic) {
		this.useridPic = useridPic;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	@Override
	public String toString() {
		return "HomeUser{" +
				"userid='" + userid + '\'' +
				", password='" + password + '\'' +
				", nickname='" + nickname + '\'' +
				", useridPic='" + useridPic + '\'' +
				", mobile='" + mobile + '\'' +
				", address='" + address + '\'' +
				", qq='" + qq + '\'' +
				", status=" + status +
				'}';
	}
}
